<template>
	<div id="test" class="mui-numbox" data-numbox-min='1'>
		<button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
		<input class="mui-input-numbox" type="number" value="1" ref="numberbox" @change="getCount"/>
		<button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
	</div>
</template>
<script>
import  mui from '../../lib/mui/js/mui.js'
mui("#test").numbox();
export default {
    data(){
		return {
			// max:this.max
		}
	},
	methods:{
		getCount(){ 
			
			this.$emit('getCount',this.$refs.numberbox.value)
			// console.log(this.$refs.numberbox.value);
		}
	},
	props:['max'],
	watch:{
		'max':function(newval,oldval){
			if(newval!=undefined){
				mui("#test").numbox().setOption('max',newval)	
			}
		}
	}
}
</script>
<style lang="scss" scoped>

</style>
